package org.spring.beans.factory.config;

import java.lang.reflect.Field;

public class DependencyDescriptor {
	private Field field;
	private boolean required;

	public DependencyDescriptor(Field field, boolean required) {
		this.field = field;
		this.required = required;
	}
	
	public Class<?> getDependencyType(){
		if(field != null) {
			return field.getType();
		}else {
			throw new RuntimeException("only support field dependency");
		}
	}
	public boolean isRequired() {
		return this.required;
	}
}
